package com.letsiot.applications.repository;

import org.apache.ibatis.annotations.Param;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Repository;

import com.letsiot.applications.entity.SysMessage;

@Repository
public interface SysMessageMapper {

    int deleteByPrimaryKey(Long id);

    int insert(SysMessage record);

    int insertSelective(SysMessage record);

    SysMessage selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(SysMessage record);

    int updateByPrimaryKey(SysMessage record);

    Page<SysMessage> listMessage(@Param("query") SysMessage query, Pageable pageable);

    int countByMessageTypeAndModule(@Param("messageType") String messageType, @Param("moduleCode") String moduleCode,
            @Param("isread") String isread);

    SysMessage findWarningMessageCode(@Param("messageCode") String messageCode);
}